package online.heycm.codegenerator.common.error;

import online.heycm.platform.common.entity.result.ErrorCode;

/**
 * @author hey
 * @version 1.0
 * @date 2023/12/21 14:13
 */
public enum CodeMsg implements ErrorCode {
    ERROR_SERVER(500, "服务器错误"),
    ERROR_PARAMETER(400, "参数错误"),
    INVALID_SESSION(401, "Session is invalid"),
    INVALID_SSE(1000, "SSE is invalid"),
    INVALID_FILE(1001, "无效的文件"),
    INVALID_DB_CONNECTION(1002, "无效的数据库连接"),
    SESSION_STORAGE_FULL(1003, "当前在线人数过多，请稍后再试~");

    private final int code;

    private final String message;

    CodeMsg(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public int code() {
        return code;
    }

    @Override
    public String message() {
        return message;
    }
}
